package com.yang.concurrency.chapter4;

import java.util.Optional;

/**
 * @Author: 血魔
 * @Date: Created in 15:42 2021/12/12
 * @Version: $
 */
public class ThreadSimpleAPI {
    public static void main(String[] args) {
        Thread t = new Thread( () -> {
            Optional.of("Hello").ifPresent(System.out::println);
            try{
                Thread.sleep(100*100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            }, "陈瑾玉");

        t.start();
        Optional.of(t.getName()).ifPresent(System.out::println);
        Optional.of(t.getId()).ifPresent(System.out::println);
        Optional.of(t.getPriority()).ifPresent(System.out::println);


    }
}
